#! /usr/bin/env node

import {
	createFile,
	logHelp
} from './controller/index.controller';
import { loading } from './loading/index';

const [ ,,type,filename ] = process.argv;

const options = {
	'create':createFile,
	'--help':logHelp
};
try {
	loading.start();
	// 当前命令为执行创建命令
	options[type](filename);
} catch (error) {
	loading.out();
	logHelp();
}
